import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const routes = [
	{
		path: '/',
		name: 'Index',
		component: () => import('@/views/Index'),
		meta: {
			title: 'Visualio 数字化管理平台'
		}
	},
	{
		path: '/Home',
		name: 'Home',
		redirect: '/Home/pageManage',
		component: () => import('@/views/Home'),
		children: [
			{
				path: 'PageManage',
				name: 'PageManage',
				component: () => import('@/views/PageManage/index.vue'),
				meta: { title: '个人空间', icon: 'add-file' }
			},
			{
				path: 'UploadFile',
				name: 'UploadFile',
				component: () => import('@/views/UploadFile/index.vue'),
				meta: { title:'资源管理', icon: 'folder' }
			},
			{
				path: 'DeleManage',
				name: 'DeleManage',
				component: () => import('@/views/DeleteManage/index.vue'),
				meta: { title: '历史删除', icon: 'delete-manage' }
			},
			{
				path: 'DrawCanvas',
				name: 'DrawCanvas',
				component: () => import('@/views/DrawCanvas/index.vue'),
				meta: { title: '画布', icon: 'draw' }
			},
			{
				path: 'SvgManage',
				name: 'SvgManage',
				component: () => import('@/views/SvgManage/index.vue'),
				meta: { title: '图标管理', icon: 'svg-icon' }
			},
			{
				path: 'ModelManage',
				name: 'ModelManage',
				component: () => import('@/views/ModelManage/index.vue'),
				meta: { title: '代码生成', icon: 'code' }
			},
			{
				path: 'DataSource',
				name: 'DataSource',
				component: () => import('@/views/DataSource/index.vue'),
				meta: { title: '数据源管理', icon: 'data-source' }
			},
			// {
			// 	path: 'TableTemplate',
			// 	name: 'TableTemplate',
			// 	component: () => import('@/views/TableTemplate/index.vue'),
			// 	meta: { title: '前端模版', icon: 'icon' }
			// }
		]
	},
	{
		path: '/Design',
		name: 'Design',
		component: () => import('@/views/Design'),
		meta: {
			title: '设计文件'
		}
	},
	{
		path: '/Page',
		name: 'Page',
		meta: {
			title: '预览'
		},
		component: () => import('@/views/PageView/index.vue'),
	},
	{
		path: '/Login',
		name: 'Login',
		component: () => import('@/views/Login'),
		meta: {
			title: '登录'
		}
	}
]

export default new Router({
	// mode: 'history',
	base: process.env.BASE_URL,
	routes,
})
